package net.yxsoft.kit;

import com.jfinal.plugin.activerecord.ActiveRecordPlugin;

import com.jfinal.plugin.activerecord.DbKit;

import com.jfinal.plugin.druid.DruidPlugin;

/**
 * @author wj
 * @动态添加数据源
 */
public class wbdata   {
    public static  void DbConect(String url,String  username,String password,String dataname) {
        DruidPlugin dp=new DruidPlugin(url,username,password);
//先运行，不然会找不到资源
        dp.start();
        ActiveRecordPlugin arp = new ActiveRecordPlugin(dataname,dp);
        DbKit.removeConfig(dataname);
//运行就行了
        arp.start();
    }
}